﻿using IdentityModel;
using IdentityServer4;
using IdentityServer4.Test;
using Microsoft.AspNetCore.Identity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Text.Json;
using System.Threading.Tasks;

namespace IdentityServer
{
    public class AbpUsers : IdentityUser
    {

        //自定义扩展属性


        /// <summary>
        /// 用户来源
        /// </summary>
        public string? Source { get; set; }

        //public string Destination { get; set; }

        public static List<AbpUsers> Users
        {
            get
            {
                var address = new
                {
                    street_address = "金柏路",
                    locality = "Heidelberg",
                    postal_code = 69118,
                    country = "中国"
                };

                return new List<AbpUsers>
                {
                    new AbpUsers
                    {
                         UserName ="admin",
                         Id=Guid.NewGuid().ToString(),
                         PasswordHash ="123456",
                         Email="8982378@qq.com",
                         EmailConfirmed = false,
                         AccessFailedCount=1000,
                         PhoneNumber="15896352569"
                        
                        
                        //SubjectId = "1",
                        //Username = "admin",
                        //Password = "123456",
                        //Claims =
                        //{
                        //    new Claim(JwtClaimTypes.Name, "吴镇宇"),
                        //    new Claim(JwtClaimTypes.GivenName, "吴"),
                        //    new Claim(JwtClaimTypes.FamilyName, "镇宇"),
                        //    new Claim(JwtClaimTypes.Email, "8982378@qq.com"),
                        //    new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean),
                        //    new Claim(JwtClaimTypes.WebSite, "http://www.baidu.com"),
                        //    //new Claim(JwtClaimTypes.Address, JsonSerializer.Serialize(address), IdentityServerConstants.ClaimValueTypes.Json),
                        //    new Claim(JwtClaimTypes.Address, "中华人民共和国河南省郑州市"),
                        //    new Claim(JwtClaimTypes.Role,"admin")//添加角色
                        //},

                    }
                };
            }
        }
    }
}
